package com.cheejee.goodscenter.module.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.cheejee.goodscenter.validated.InsertGroup;
import com.cheejee.goodscenter.validated.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class BrandPropertiesGroup {

	@NotNull(message = "品牌属性分组id不能为空", groups = UpdateGroup.class)
    private Integer id;

	@NotNull(message = "品牌id不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private Integer brandId;

	@NotBlank(message = "品牌属性分组名称不能为空", groups = {InsertGroup.class, UpdateGroup.class})
	@Length(max = 200, message = "品牌属性分组名称长度不能超过200字", groups = { InsertGroup.class, UpdateGroup.class })
    private String groupName;

    private String describe;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBrandId() {
        return brandId;
    }

    public void setBrandId(Integer brandId) {
        this.brandId = brandId;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName == null ? null : groupName.trim();
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe == null ? null : describe.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", brandId=").append(brandId);
        sb.append(", groupName=").append(groupName);
        sb.append(", describe=").append(describe);
        sb.append("]");
        return sb.toString();
    }
}